package com.yangyang.androidconnect.task;

import android.os.FileObserver;
import android.util.Log;

import com.yangyang.androidconnect.util.DCIMFileUtil;

public class DCIMFileObserver extends FileObserver {

    public DCIMFileObserver(String path) {
        super(path);
    }

    @Override
    public void onEvent(int event, String path) {
        if (event == CREATE || event == DELETE || event == MOVED_FROM || event == MOVED_TO) {
            Log.d("DCIMFileObserver", "File changed: " + path);
            // 更新缓存或重新加载文件列表
            DCIMFileUtil.updateCache(); // 重新加载
        }
    }
}